Skip tasks or error out when resources are missing #351
+203
−48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses a lingering issue from #296, where we didn't adequately protect ourselves from incorrectly handling "empty set" inputs and wrongly marking them as complete. I've decided to go the simplest route and refuse to handle empty-sets unless specifically told to. I think this is appropriate given how unlikely empty sets are in the real world. (We see them with Cerner for some resources like ServiceRequest, but it's the exception not the rule.)
(An alternate solution that I did consider was looking at the bulk export log if it was present, and seeing what resources were exported - then continuing if the export log says it exported Patients, even if no patient files where present. But it seemed more complicated code-wise and more brittle if users are moving files around. The approach I went with requires a human in the loop to agree to allow empty sets. Or... someone just adds the --allow flag to their scripts and we lose this protection anyway - but that's at least not on me. 😄)
Checklist
docs/
) needs to be updated